package com.cn.data.multipledata.api.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.cn.data.commont.entity.AppUser;
import com.cn.data.commont.entity.AppUserXinDong;
import com.cn.data.multipledata.api.mapper.AppUserXinDongMapper;
import com.cn.data.multipledata.api.service.AppUserXinDongService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@DS("two")
public class AppUserXinDongServiceImpl extends ServiceImpl<AppUserXinDongMapper, AppUserXinDong> implements AppUserXinDongService {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Override
    public List<AppUserXinDong> getList() {
//        String sql="select userid,coin,create_time,avatar,nickname,mobile,password,salt from app_user";
        String sql="select userid,birthday from app_user";
        List<AppUserXinDong> appUser = jdbcTemplate.query(sql, new BeanPropertyRowMapper<AppUserXinDong>(AppUserXinDong.class));
     return appUser;
    }
}
